class Solution:
	# @return a boolean
	def isPalindrome(self, x):
		if x < 0:
			return False
		z = x
		num = 0
		while(z > 0):
			z /= 10
			num += 1
		for i in xrange(num/2):
			a, b = self.getDigit(x, i), self.getDigit(x, num-i-1)
			if a != b:
				return False
		return True

	def getDigit(self, number, index):
		while index >= 1:
			number /= 10
			index -= 1
		return number % 10

if __name__ == '__main__':
	so = Solution()
	print so.isPalindrome(-214748)